import Icon from "@/components/icon";

import { useHistory } from "react-router-dom";
type Styles = {
  width: string;
  height: string;
};

interface Props {
  onClick?: () => void;
  style?: Styles;
}
export default function Back({ onClick }: Props) {
  const history = useHistory();
  return (
    <Icon
      type="iconfanhui"
      onClick={() => {
        if (typeof onClick === "function") onClick();
        history.goBack();
      }}
    />
  );
}
